PATHMac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Window Manager >

Programming With the Mac OS 8.5 Window Manager


SetWindowBounds

Sets a window's size and position from the bounding rectangle of the specified window region.

pascal OSStatus SetWindowBounds (
                     WindowPtr window,
                     WindowRegionCode regionCode,
                     const Rect *globalBounds);
window
A value of type WindowPtr . Pass a pointer to the window whose bounds are to be set.
regionCode
A value of type WindowRegionCode . Pass in a constant specifying the region to be used in determining the window's size and position. With Mac OS 8.5, the only valid values for the region code are kWindowStructureRgn and kWindowContentRgn ; see Mac OS 8 Window Manager Reference for descriptions of these and other WindowRegionCode constants.
globalBounds
A pointer to a structure of type Rect . Before calling SetWindowBounds , set the rectangle to specify the dimensions and position, in global coordinates, of the window region specified in the regionCode parameter.
function result
A result code. See Result Codes.
DISCUSSION

The SetWindowBounds function sets a window's size and position to that specified by the rectangle that your application passes in the globalBounds parameter. After doing so, SetWindowBounds displays the window.

When you call the SetWindowBounds function, your application specifies whether the window's content region or its structure region is more important in determining the window's ultimate size and position. This distinction can be important with versions of the Mac OS running the Appearance Manager, since the total dimensions of a window--and, therefore, its spatial relationship to the rest of the screen--may vary from appearance to appearance. In general, you should specify kWindowStructureRgn for the regionCode parameter if how the window as a whole relates to a given monitor is more important than the exact positioning of its content on the screen. On the other hand, if you specify kWindowContentRgn for the regionCode parameter because the positioning of your application's content is of greatest concern, then it is important to note that with some appearances some part of the window's structure region or "frame" may extend past the edge of a monitor and not be displayed.

VERSION NOTES

Available with Mac OS 8.5 and later.

SEE ALSO

The function GetWindowBounds .


© 1999 Apple Computer, Inc. – (Last Updated 18 March 99)